<script setup>

import { useRouter } from 'vue-router';
defineProps({
  personal: {
    required: true,
    type: Object,
  },
});

const router=useRouter()
</script>

<template>

  <div class="box" >
    <div style="margin-top: 28px; ">
      <div class="avatar" @click="router.push(`/personalCenter/${personal.userId}`)">
        <img width="38px" v-if="personal.avatar!='default.jpg'" :src="personal.avatar">
              <img v-else width="38px" src="@/assets/boy.jpg" />
            
      </div>
      <div class="info">
        <span
          >{{ personal.userName }} 
          
        </span>
        <span style="font-size: small;">{{personal.autograph}}</span>
      </div>
    </div>
  
      <div class="follow">
        <slot name="follow"></slot>
      </div>
    
  </div>
</template>

<style scoped>
.box {
  float: left;
  width: 100%;
  height: 90px;
  border: 1px solid #eeeaea;
  position: relative;
  .info {
    float: left;
    margin-left: 15px;
  }
  .info span {
    display: block;
  }
  .avatar {
    margin-left: 30px;
    float: left;
    height: 100px;
  }
  .follow{
    float: left;
    position: absolute;
    right: 0;
    margin-right: 50px;
  }
}
</style>
